﻿<%@ WebHandler Language="C#" Class="getmymancount2" %>

using System;
using System.Web;
using System.Web.SessionState;
using TSqlServer;

public class getmymancount2 : IHttpHandler, IReadOnlySessionState
{
    
    public void ProcessRequest (HttpContext context) {
        string uid = context.Session["ecrm_uid"].ToString();

        context.Response.ContentType = "text/plain";
        context.Response.Write(myCountMan(uid).ToString());
        context.Response.End();
    }

    private int myCountMan(string uid)
    {
        int result = 0;

        string sSql = "select count(*) from t_linkman where status=0 and inman='" + uid + "'";
        TSqlDBReader2 oRS = new TSqlDBReader2(sSql);
        if (oRS.FDataReader.Read())
        {
            result = (int)oRS.FDataReader.GetValue(0);
        }
        oRS.Free();

        return result;
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}